<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            width: 200px;
            height: 200px;
            background-color: skyblue;
        }
    </style>
    <script src="jquery.min.js"></script>
    <script>

    </script>
</head>
<body>
    <div></div>
    <ul>
        <li>黑色毛衣</li>
        <li>可爱女人</li>
        <li>东风破</li>
        <li>七里香</li>
    </ul>
    <button>按钮</button>
    <p>周杰伦</p>
    <script>
        $('div').on({
            click:function(){
                console.log('---------点击div--------');
            },
            mouseenter:function(){
                console.log('-----------mouseenter------------');
            },
            mouseout:function(){
                console.log('-------------mouseout-----------');
            }
        });
        $('ul').on('click','li',function(){
            console.log(this);
        });

        $('button').click(function(){
            // 1. off 关键字， 解除所以的事件
            // $('div').off();

            // 2.解除当个事件
            $('div').off('click');

            // 3.委托事件的解除
            $('ul').off('click','li');
        });

        // 4.只触发一次,自动解除的事件
        $('p').one('click',function(){
            console.log($(this).html());
        });
    </script>
</body>
</html>